﻿CREATE PROCEDURE [dbo].[proc_Department_Update]
	(
		@DName nvarchar(50),
		@ParentId int,
		@CompanyId int,
		@Sort int,
		@Id int
	)
AS
--Declare @pid int 
--select @pid=ParentId from Department where id=@Id

	if(@Id <>@ParentId)
		begin
			Update Department Set
			DName=@DName,
			ParentId=@ParentId,
			CompanyId=@CompanyId,
			Sort=@Sort
			Where Id=@Id
			
			
			
			
			
			
		end
		
		







	RETURN
	
	
	
	